package com.jc.order.constant;

public enum CurrencyEnum {
    EUR("EUR", "欧元"),
    ATS("ATS", "奥地利先令"),
    AUD("AUD", "澳大利亚元"),
    BEF("BEF", "比利时法郎"),
    CAD("CAD", "加拿大元"),
    CHF("CHF", "瑞士法郎"),
    CNY("CNY", "人民币"),
    DEM("DEM", "德国马克"),
    DKK("DKK", "丹麦克朗"),
    ECU("ECU", "欧洲通用货币"),
    ESP("ESP", "西班牙比塞塔"),
    FIM("FIM", "芬兰马克"),
    FRF("FRF", "法国法郎"),
    GBP("GBP", "英镑"),
    HKD("HKD", "港元"),
    ITL("ITL", "意大利里拉"),
    JPY("JPY", "日元"),
    MOP("MOP", "澳门元"),
    MYR("MYR", "马来西亚林吉特"),
    NLG("NLG", "荷兰盾"),
    NOK("NOK", "挪威克朗"),
    NTD("NTD", "新台币"),
    NZD("NZD", "新西兰元"),
    PHP("PHP", "菲律宾比索"),
    SEK("SEK", "瑞典克朗"),
    SGD("SGD", "新加坡元"),
    THB("THB", "泰国铢"),
    USD("USD", "美元"),
    KRW("KRW", "韩国元"),
    BRL("BRL", "巴西雷亚尔"),
    ASF("ASF", "清算瑞士法郎"),
    EGP("EGP", "埃及镑"),
    RUB("RUB", "俄罗斯卢布"),
    BDT("BDT", "孟加拉塔卡"),
    INR("INR", "印度卢比"),
    IDR("IDR", "印尼卢比"),
    LKR("LKR", "斯里兰卡卢比"),
    OMR("OMR", "阿曼里亚尔"),
    PKR("PKR", "巴基斯坦卢比"),
    SAR("SAR", "沙特里亚尔"),
    VND("VND", "越南盾");

    private final String code;
    private final String name;

    CurrencyEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CurrencyEnum getByCode(String code) {
        for (CurrencyEnum item : CurrencyEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}